package io.github.talelin.latticy.bo;

import io.github.talelin.latticy.model.BannerDO;
import io.github.talelin.latticy.model.BannerItemDO;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.util.List;

@Data
@NoArgsConstructor
public class BannerWithItems {

    private Long id;
    private String name;
    private String keyword;
    private String img;
    private Integer type;

    private List<BannerItemDO> items;

    public BannerWithItems(BannerDO banner,List<BannerItemDO> items) {
        BeanUtils.copyProperties(banner,this);
        this.setItems(items);
    }
}
